package com.chat.entity;

import java.io.Serializable;

/**
 * 用户实体类
 * @author LinYang
 * @date 2022-11-08
 */
public class User extends Entity implements Serializable {
    private int userId;
    private String account;
    private String password;
    private String name;
    private String regDate;
    private String rose;
    private int fileId;


    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRegDate() {
        return regDate;
    }

    public void setRegDate(String regDate) {
        this.regDate = regDate;
    }

    public String getRose() {
        return rose;
    }

    public void setRose(String rose) {
        this.rose = rose;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getFileId() {
        return fileId;
    }

    public void setFileId(int fileId) {
        this.fileId = fileId;
    }

    /**
     * 用户账号是否符合规则
     *
     * 用户检查
     * step1 检查用户名，账号，密码是否符合规则
     * setp2 检查用户账号是否存在
     *
     * @return 如果符合则返回 true
     */
    public boolean isMatchRule(){
        if(account==null||account.equals("")||account.length()<=6||password==null||password.equals("")||password.length()<=6)
            return false;
        return true;
    }
}
